Add additional guardrails and checks against nil pointers; clean up some confusing code as well#1063
Merged
Merged
Conversation
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
eslerm
approved these changes
Jul 29, 2025
eslerm
left a comment
Contributor
There was a problem hiding this comment.
Cheers for sharing nilaway.
Adding linting and guardrail notes to https://eng.inky.wtf/docs/teams/product-security/best-practices/ may be helpful for future SDLC planning.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR applies fixes to most of the
nilawayfindings that popped up when run against the entire project with the exception of buffer pools we initialize.Additionally, I cleaned up some confusing
strings.gocode and simplified quite a bit of its functionality (for instance, we weren't really using the buffers so there wasn't any reason to keep that around).Most of the changes involve checking for nil
Reports or ensuring slices are of a certain length before we try to access any of their contents. This has historically been ~fine, but only because we have consistent naming and avoided edge cases. Otherwise, any one of these is likely to happen when using different rule names/path formats/etc.